<template>
  <div class="header">
    <div class="header-title">
      <h1 style="cursor: pointer" @click="$router.push('/')">柳州中心工企业应急周转资金申请平台</h1>
    </div>
    <div class="header-area">
      <div class="header-msg">
        <i class="iconfont icon-msg-system"></i>
      </div>
      <div class="header-download">
        <i class="iconfont icon-download"></i>
      </div>
      <img class="header-avatar" :src="user.avatar" alt="">
      <div class="header-user-info" @click="$router.push('/home/personal-information')">
        <dl>
          <dd class="header-user-mark">欢迎您！</dd>
          <dt class="header-user-nickName">{{user.username}}</dt>
        </dl>
      </div>
    </div>
  </div>
</template>

<script>

export default {
  name: "topHeader",
  data(){
    return {
      user:{},
      nickName: '张万志'
    }
  },
  async mounted(){
    this.user = await this.$store.dispatch('getUser');// 在vuex中获取到用户信息
  }
}
</script>

<style src="./index.less" lang="less" scoped>

</style>
